package com.cbn.ibcp.web.client;

import com.cbn.ibcp.web.client.dto.ResBaseDTO;
import com.cbn.ibcp.web.client.dto.ResourceStreamOrgDTO;
import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import org.apache.ibatis.annotations.Param;

@BaseRequest(baseURL = "${dataInjectionUrl}", contentType = "application/json")
public interface DataInjectionClient {


    /**
     * 触发源站数据注入
     *
     * @param reinject
     * @param videoId
     * @return
     */
    @Get("/v1/video/trigger?reinject={0}&videoId={1}")
    String originVideoTrigger(@Param("reinject") Boolean reinject, @Param("videoId") String videoId);


    /**
     * 修改源站res_base注入状态信息
     *
     * @param resBaseDTO
     * @return
     */
    @Post(value = "/v1/operator/modifyOriginResBase")
    String modifyOriginResBase(@JSONBody ResBaseDTO resBaseDTO);


    /**
     * 修改分省resource_stream_org注入状态信息
     *
     * @return
     */
    @Post("/v1/operator/modifyProvinceResourceStreamOrg")
    String modifyProvinceResourceStreamOrg(@JSONBody ResourceStreamOrgDTO resourceStreamOrgDTO);


    /**
     * 触发分省数据注入
     *
     * @param orgCode
     * @param reinject
     * @param videoId
     * @return
     */
    @Get("/v1/video/trigger?orgCode={0}&reinject={1}&videoId={2}")
    String provinceVideoTrigger(@Param("orgCode") String orgCode, @Param("reinject") Boolean reinject, @Param("videoId") String videoId);

    /**
     * 修改源站注入状态
     *
     * @param videoId
     * @param injectStatus
     * @return
     */
    @Get("/v1/inject-status/modify?videoId={0}&injectStatus={1}")
    String modifyOriginInjectStatus(@Param("videoId") String videoId, @Param("injectStatus") Integer injectStatus);


    /**
     * 修改分省注入状态
     *
     * @param videoId
     * @param injectStatus
     * @param orgCode
     * @return
     */
    @Get("/v1/inject-status/modify?videoId={0}&injectStatus={1}&orgCode={2}")
    String modifyProvinceInjectStatus(@Param("videoId") String videoId, @Param("injectStatus") Integer injectStatus, @Param("orgCode") String orgCode);

}
